package com.nami.gate.router.middleware.mq;

public interface MqSender {

    void start() throws Exception;

    /**
     * 分区消费 定向消费， 慎重，每个logic 有qos，必须发送到定向logic才可以，不然会丢消息
     * @param topic
     * @param key 比如userId
     * @param msg
     * @return
     */
    boolean send(String topic, String key, String msg) throws Exception;

    boolean send(String topic, String msg) throws Exception;

    boolean send(String topic, byte[] msg) throws Exception;

    /**
     * shutdown
     */
    void shutdown();

}
